//
//  DCLoginViewController.m
//  Dearcare
//
//  Created by Laojingxing on 2018/11/5.
//  Copyright © 2018年 laojingxing. All rights reserved.
//

#import "DCLoginViewController.h"

@interface DCLoginViewController ()
@property (weak, nonatomic) IBOutlet UILabel *veryCodeLoginLabel;
@property (weak, nonatomic) IBOutlet UIView *veryCodeUnlineView;
@property (weak, nonatomic) IBOutlet UILabel *passwordLoginLabel;
@property (weak, nonatomic) IBOutlet UIView *passwordUnLineView;
@property (weak, nonatomic) IBOutlet UITextField *phoneNumTextField;
@property (weak, nonatomic) IBOutlet UITextField *verifyOrPasswordTextField;

//
@property (weak, nonatomic) IBOutlet UIView *verifyBGView;
@property (weak, nonatomic) IBOutlet UILabel *verifytitleLabel;

@property (weak, nonatomic) IBOutlet WLBaseButton *loginButton;

@end

@implementation DCLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self _initSubViews];
}

- (void)viewWillAppear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

- (void)_initSubViews {
    UITapGestureRecognizer *veryCodeTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(veryCodeAction)];
    self.veryCodeLoginLabel.userInteractionEnabled = YES;
    [self.veryCodeLoginLabel addGestureRecognizer:veryCodeTap];

    UITapGestureRecognizer *passwordCodeTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(passwordLoginAction)];
    self.passwordLoginLabel.userInteractionEnabled = YES;
    [self.passwordLoginLabel addGestureRecognizer:passwordCodeTap];
    
    self.loginButton.enabled = NO;
    self.passwordUnLineView.layer.cornerRadius = self.passwordUnLineView.height / 2.0;
    self.veryCodeUnlineView.layer.cornerRadius = self.veryCodeUnlineView.height / 2.0;
}

- (void)passwordLoginAction {
    self.veryCodeUnlineView.hidden = YES;
    self.passwordUnLineView.hidden = NO;
    self.veryCodeLoginLabel.textColor = kTextGray;
    self.passwordLoginLabel.textColor = kTexRed;
}

- (void)veryCodeAction {
    self.veryCodeUnlineView.hidden = NO;
    self.passwordUnLineView.hidden = YES;
    
    self.veryCodeLoginLabel.textColor = kTexRed;
    self.passwordLoginLabel.textColor = kTextGray;
}

- (IBAction)sendVerifyAction:(id)sender {
    
}

// 返回注册
- (IBAction)backtoRegisterAction:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)loginAction:(id)sender {
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
